home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume25 / finger / part07 < prev    next >
Encoding:
Text File  |  1992-04-04  |  50.7 KB  |  1,747 lines

  1. Newsgroups: comp.sources.unix
  2. From: phil@Shiva.COM (Phil Budne)
  3. Subject: v25i170: finger - Phil's Finger Program, Part07/07
  4. Sender: unix-sources-moderator@pa.dec.com
  5. Approved: vixie@pa.dec.com
  6.  
  7. Submitted-By: phil@Shiva.COM (Phil Budne)
  8. Posting-Number: Volume 25, Issue 170
  9. Archive-Name: finger/part07
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 7 (of 7)."
  18. # Contents:  History.h getttyloc.c
  19. # Wrapped by budd@bu-it on Fri Jul  6 13:22:07 1990
  20. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  21. if test -f History.h -a "${1}" != "-c" ; then 
  22.   echo shar: Will not over-write existing file \"History.h\"
  23. else
  24. echo shar: Extracting \"History.h\" \(31479 characters\)
  25. sed "s/^X//" >History.h <<'END_OF_History.h'
  26. X/*-*-text-*-*/
  27. X/*
  28. X * Copyright (C) 1986, 1990  Philip L. Budne
  29. X *
  30. X * This file is part of "Phil's Finger Program".
  31. X *
  32. X * This program is free software; you can redistribute it and/or modify
  33. X * it under the terms of the GNU General Public License as published by
  34. X * the Free Software Foundation; either version 1, or (at your option)
  35. X * any later version.
  36. X *
  37. X */
  38. X
  39. X# define HISTORY_RCSID "$Id: History.h,v 3.0 90/07/06 13:09:46 budd Rel $"
  40. X
  41. X# ifdef __GNUC__x        /* works in GCC 1.20 and up */
  42. X# define B(x)            /* RMS does not believe in regression tests! */
  43. X# else  /* __GNUC__x not defined */
  44. X# define B(x) : x
  45. X# endif /* __GNUC__x not defined */
  46. X
  47. Xstruct _JBVER {
  48. X    unsigned who   B(3);    /* 0=development group, 1=other digital */
  49. X                /* 2,3,4 customer; 5,6,7 customer's user */
  50. X    unsigned major B(9);
  51. X    unsigned minor B(6);
  52. X# if 1
  53. X    unsigned edit  B(18);
  54. X# else  /* not 1 */
  55. X    unsigned flag  B(1);
  56. X    unsigned edit  B(17);
  57. X# endif /* not 1 */
  58. X};
  59. X
  60. X/*
  61. X * For the uninformed:
  62. X *
  63. X * This is the format TOPS-10 uses to store version numbers.  Word
  64. X * 0137 in low core -- The JOB DATa area (JOBDAT) is called .JBVER
  65. X *
  66. X * TOPS-20 uses it too, with minor perversions: major/minor edits are
  67. X * displayed as major.minor (5.1 rather than 5A) If the high order bit
  68. X * of edit is set (0400000) the low 17 bits are printed in decimal.
  69. X *
  70. X */
  71. X
  72. X/****************************************************************
  73. X
  74. X    Pre-History:
  75. X
  76. X    Nov 85 -- Work began with code that is now maketree and dofinger.
  77. X          Just printed current users nicely.
  78. X    Dec 85 -- enhanced ttylocs.
  79. X    Jan 86 -- Command line parsing added.
  80. X
  81. X100    Wed May 21, 1986    Phil
  82. X    Start History file.
  83. X    Allow slash switches appended directly to unames.
  84. X    Create routine doswitch().
  85. X    Files:
  86. X        args.c
  87. X
  88. X101    Wed May 28, 1986    Phil
  89. X    Display last login host uppercase.
  90. X    Remove ".arpa" in undomain.
  91. X    Files:
  92. X        lastlog.c    undomain.c
  93. X
  94. X102    Thurs May 28, 1986    Phil
  95. X    Wrote my own getutmp().
  96. X    Flush SYS V utmp.c
  97. X    Files:
  98. X        getut.c
  99. X
  100. X103    Thurs May 28, 1986    Phil
  101. X    Massive cleanup.  Add copyrights,
  102. X    make sure to use finger.h
  103. X    Display [n.n.n.n]
  104. X    Files:
  105. X        doremote.c ....
  106. X
  107. X**** given to sundar@mit-hermes ****
  108. X
  109. X104    July 16, 1986        BZS
  110. X    Add SYSLOG option to fingerd.c
  111. X
  112. X105    August 12, 1986        Phil
  113. X    Add ttyplace, ttyrandom options to ttyask.c
  114. X
  115. X106    August 12, 1986        Phil
  116. X    Add -j option to force whoj output
  117. X    Files:
  118. X        args.c args.h
  119. X
  120. X107    Weds Sept 3, 1986    Phil
  121. X    Merge in stuff for Umax (Encore Multimax 4.2) [under ifdef Umax]
  122. X    Files:
  123. X        luser.h    getttyloc.c output.c
  124. X        getcommand.c readpr.c fingerd.c
  125. X
  126. X108    Sat Sept 27, 1986    Phil
  127. X    Remove "On since" since it only applies to one login.
  128. X    Files:
  129. X        whois.c
  130. X
  131. X109    Thus Oct 2, 1986    Phil
  132. X    Add hackery for "consdev" on sun. Does the right thing when
  133. X    console is really a printer on ttya, but not when workstation
  134. X    with a console window.
  135. X    Files:
  136. X        readpr.c getcommand.c
  137. X
  138. X110    Thus Oct 2, 1986    Phil
  139. X    Add NETLOC and OTTYLOC conditionals.
  140. X    Files:
  141. X        getttyloc.c locname.c
  142. X
  143. X111    Fri Oct 3, 1986        Phil
  144. X    Add (/L) sw_location -- ignore user ttyloc
  145. X    Files:
  146. X        getttyloc.c args.h args.c
  147. X
  148. X112    Mon Oct 6, 1986        Phil
  149. X    Fix undomain
  150. X    File:
  151. X        undomain.c
  152. X
  153. X113    Mon Oct 6, 1986        Phil
  154. X    Merge in working inq_stats code for Umax (encore)
  155. X    Files:
  156. X        undomain.c
  157. X
  158. X114    Weds Oct 22, 1986    Phil
  159. X    Make getcommand() return struct pr.
  160. X    Print flag for suid programs.
  161. X    Make room for inquire group.
  162. X    Split off whoj.c and finger.c from output.c.
  163. X    Add ifdef lint around copyright in finger.h.
  164. X    Create inquire.c hook into inquire/holmes.
  165. X    Add fields in person struct, move p_Rc into p_flags.
  166. X    Files:
  167. X        whoj.c finger.c output.c finger.h inquire.c getperson.c
  168. X
  169. X115    Wednesday October 28, 1986    Phil
  170. X    Create code to use mmap to read process table, and upage
  171. X    pagemaps.  Code to read actual upage(s) does not work.  (MAP
  172. X    UMAP1 UMAP2 in map.h).  Performance win is barely noticeable
  173. X    Create names.c syms.h info.h. Read namelist into info struct
  174. X    and save as /etc/saved-finger-namelist.  BIG win, bigger than
  175. X    any crock in readpr.
  176. X    Files:
  177. X        readpr.c names.c syms.h info.h map.h
  178. X
  179. X116    Thursday October 29, 1986    Phil
  180. X    create ttycycle (ttyask -c[time]).  Cycles thru ttylplaces
  181. X    sleeping for time seconds.
  182. X    Files:
  183. X        ttyask.c
  184. X
  185. X**** second version given to sundar@hermes ****
  186. X
  187. X117    Saturday November 1, 1986    Phil
  188. X    Split readpr.c into kmem.c, readpr.c, ustruct.c
  189. X    Split pr.h into pr.h and kmem.h
  190. X    Files:
  191. X        getcommand.c readpr.c pr.h
  192. X
  193. X118    Sunday November 1, 1986        Phil
  194. X    Add optional ttyrandom cycling (ttyask -r<time>), -b(ackground).
  195. X    Add savewho/checkwho to kill self when parent goes away.
  196. X    File:
  197. X        ttyask.c
  198. X
  199. X119    Monday November 3, 1986        Phil
  200. X    Append suid character to program name.
  201. X    Start playing with new select stuff (+tty .)
  202. X    Files:
  203. X        finger.c select.h select.c args.c
  204. X
  205. X120    Sunday, November 9, 1986    Phil
  206. X    Make ttyloc check tty ownership, remove fchown().
  207. X    Files:
  208. X        ttyloc.c
  209. X
  210. X121    Monday, November 10, 1986    Phil
  211. X    Don't decr todo counter unless hit has no person entry in pwtree.
  212. X    Files:
  213. X        getperson.c
  214. X
  215. X122    Monday, November 10, 1986    Phil
  216. X    Implement blankline(), better defaults for empty fields in finger.
  217. X    Files:
  218. X        getperson.c doremote.c mcheck.c
  219. X        finger.c inquire.c output.c
  220. X
  221. X
  222. X123    Wednesday, November 12, 1986    Phil
  223. X    Do NETLOC for annexes too!  Make undomain() optionally
  224. X    remove prefixes to 100% domain matches. Put it 'make depend'
  225. X    Files:
  226. X        undomain.c prefixes.h getttyloc.c lastlog.c whoj.c
  227. X        Makefile
  228. X
  229. X124    Tuesday, December 2, 1986    Phil
  230. X    zero p_count in makeperson. Warn about unknown switches.
  231. X    Files:
  232. X        getperson.c args.c
  233. X
  234. X125    Friday, January 1, 1987        Phil
  235. X    Clean up NFILE reading, rejection.
  236. X    Have ttyask use optarg(3), add -t time flag (as opposed
  237. X    too -c [time] and -r [time]), use as timeout in ttyask too.
  238. X    Files:
  239. X        names.c ttyask.c
  240. X
  241. X126    Monday, January 12, 1987    Phil
  242. X    Add read_vmunix, used to find _version in /vmunix and
  243. X    fill in info_verstr when reading nlist.
  244. X    Files:
  245. X        names.c read_vmunix.c
  246. X
  247. X127    Monday, January 12, 1987    Phil
  248. X    Add 4.3 stuff under BSD4_3; tty.h wants ioctl.h
  249. X    tty group/mesg stuff.
  250. X    Files:
  251. X        getcommand.c output.c
  252. X
  253. X128    Friday, January 16, 1987    Phil
  254. X    If stdin is not a tty, act as if /berk.
  255. X    Fix doswitch() to accept multi letter switch names.
  256. X    File:
  257. X        args.c
  258. X
  259. X129    Sunday, January 25, 1987    Phil
  260. X    Print /etc/nologin after herald.
  261. X    File:
  262. X        fingerd.c
  263. X
  264. X130    Feb 26, 1987    Phil
  265. X    Do special ttyloc display for xterms.
  266. X    File:
  267. X        getttyloc.c
  268. X
  269. X131    Friday, March 13, 1987    Phil
  270. X    Create netfinger variable, use in outchar to output <CR><LF>
  271. X    and for /berk madness (see [128])
  272. X    Files:
  273. X        args.c output.c
  274. X
  275. X
  276. X132    Sunday, March 15, 1987    Phil
  277. X    Display times more than a day, and less than 10
  278. X    using hours, not fractions of days. Handle weeks ...
  279. X    File:
  280. X        output.c
  281. X
  282. X133    Weds, April 22, 1987    Phil
  283. X    Don't set same is person && u->u_person are both NULL
  284. X    File:
  285. X        finger.c
  286. X
  287. X134    Sat, May 23, 1987    Phil
  288. X    Clean up for namelist read/write. Add AUTONLIST.
  289. X    Add fchown, fchmod in write.  Add ifdef Umax to read_vmunix.
  290. X    Files:
  291. X        names.c read_vmunix.c
  292. X
  293. X135    Mon, May 25, 1987    Phil
  294. X    Add maddr() for mailing address.
  295. X    Display '.' for biff, ',' for hungry, ';' for hungry + biff.
  296. X    Files:
  297. X        person.h finger.c mcheck.c getperson.c whois.c
  298. X
  299. X136    Tues, May 26, 1987    Phil
  300. X    Never display interval with weeks, and zero days.
  301. X    File:
  302. X        output.c
  303. X
  304. X137    Friday May 29 and (cleanup) Monday June 29, 1987  Phil
  305. X    (My father died June 10th) Use inquire for user lookup.  Use
  306. X    getpwbynam in pwtree if GETPWNAM_SLOW is not defined.
  307. X    makeperson and insert_winner take struct info pointer if
  308. X    INQUIRE is defined. Can now display a person with no password
  309. X    entry (but still has inquire entry!!)
  310. X    Files:
  311. X        getperson.c select.c inquire.c finger.c
  312. X
  313. X140    Saturday July 11, 1987        Phil
  314. X    Check if last element in second strncmp in do_ttyplace.
  315. X    File:
  316. X        ttyask.c
  317. X
  318. X141    Saturday July 11, 1987        Phil
  319. X    Change History into History.c. Create make-version, BUILD,
  320. X    and version.c (reset BUILD when History is modified?)
  321. X    Files:
  322. X        make-version History.c version.c Makefile
  323. X
  324. X142    Saturday July 11, 1987        Phil
  325. X    Implement full switch names. Add switch.h
  326. X    Only say one of forwarded and no mailbox.
  327. X    Add UNPREIX_NODOMAINS and unprefix() [helful for Xhost:display]
  328. X    Add /version
  329. X    create ttyloc.1
  330. X    Files:
  331. X        args.c switch.h mcheck.c undomain.c ttyloc.1
  332. X
  333. X143    Sunday July 12, 1987        Phil
  334. X    Implement tty selectors. +name. checks for implied leading "tty"
  335. X    Add tsel.h
  336. X    Files:
  337. X        getent.c finger.c tsel.h
  338. X
  339. X144    Sunday July 12, 1987        Phil
  340. X    Add CONC macro.  Give SYM two arguments, first string, second member.
  341. X    Put longversion[] into saved nlist file.
  342. X    Files:
  343. X        syms.h info.h names.c finger.h
  344. X
  345. X145    Monday July 13, 1987        Phil
  346. X    Add /help, values on switches.
  347. X    Files:
  348. X        switch.h args.h
  349. X
  350. X146    Tuesday July 14, 1987    2am    Phil    -- Bastile Day!!
  351. X    Add /follow, move savestr to string.c.
  352. X    Add malloc and savestr defs to finger.h
  353. X    Add <strings.h> in many places.
  354. X    Files:
  355. X        switch.h args.h select.c mcheck.c finger.h
  356. X        ttyloc.c fingerd.c whois.c getperson.c
  357. X
  358. X147    Tuesday July 14, 1987    4pm    Phil    -- Bastile Day!!
  359. X    Add readnewttyloc() new format ttyloc file (has short, line type)
  360. X    Files:
  361. X        getttyloc.c readttylocfile.c readttylocfile.h
  362. X
  363. X150    Thursday July 16, 1987        Phil
  364. X    Add getttyents() -- read 4.3 /etc/ttys file as last resort
  365. X    for tty locations.
  366. X    Files:
  367. X        getttyloc.c readttylocfile.c
  368. X
  369. X151    Thursday July 16, 1987        Phil
  370. X    Create getttytype for ttyask-ing.  Create skip.c. use in readttylocfile
  371. X    move findttyloc into readttylocfile.c make nttyloc static there.
  372. X    Files:
  373. X        getttytype.c skip.c readttylocfile.c getttyloc.c Makefile
  374. X
  375. X152    Friday July 17, 1987    2am    Phil
  376. X    Add sw_fields, /fields, set_fields (no action yet)
  377. X    Use binary search in findttyloc
  378. X    Files:
  379. X        args.c args.h switch.h readttylocfile.c
  380. X
  381. X153    Friday July 17, 1987    5pm    Phil
  382. X    Create switch.c move doswitch and other switchiness there.
  383. X    Use skipwhite and skipblack all over.
  384. X    Files:
  385. X        args.c switch.c Makefile getperson.c select.c ttyask.c
  386. X
  387. X154    Wednesday July 22, 1987    4am    Phil
  388. X    Clean up readpr, make signal state an enum. Look at it in getcommand.
  389. X    Files:
  390. X        readpr.c pr.h getcommand.c
  391. X
  392. X155    Wednesday July 22, 1987    5am    Phil
  393. X    Add ttystate, TTYSTATE
  394. X    Files:
  395. X        syms.h finger.c
  396. X
  397. X156    Thursday July 23, 1987    Phil
  398. X    Add /debug sw_debug DEBUGSW
  399. X    Files:
  400. X        args.h switch.h switch.c Makefile getcommand.c
  401. X
  402. X157    Thursday July 23, 1987    Phil
  403. X    Check for backgrounded forks which have group membership
  404. X    by being disowned and writing to tty. Add II and IID macros.
  405. X    File:
  406. X        getcommand.c
  407. X
  408. X160    Saturday July 25, 1987    Phil
  409. X    rename /save to /read. Add /nosave.  Force on when 'xf'
  410. X    Files:
  411. X        args.c args.h switch.h names.c
  412. X
  413. X161    Thursday July 30, 1987    Phil
  414. X    Set width to PLUS_INF if netfinger
  415. X    Files:
  416. X        output.c
  417. X
  418. X162    Friday July 31, 1987    Phil
  419. X    Create flags.h args.m4 flags struct.  Save Flags before
  420. X    smashing for /berk.
  421. X    Files:
  422. X        flags.h args.m4 Makefile args.c
  423. X
  424. X163    Saturday August 1, 1987    Phil
  425. X    Create local.h, removed prefixes.h.  sed UMAX to Umax.
  426. X    Move Makefile work to ymakefile
  427. X    Files:
  428. X        local.h Makefile ymakefile
  429. X
  430. X164    Monday August 3, 1987    Phil
  431. X    Remove tiresome fencepost errors.
  432. X    Files:
  433. X        getcommand.c read_vmunix.c names.c
  434. X
  435. X165    Saturday August 8, 1987    Phil
  436. X    syslog argv passed to finger.
  437. X    File:
  438. X        fingerd.c
  439. X
  440. X166    Wednesday Sept 2, 1987    Phil
  441. X    add unswitch -- detect switches on . and +
  442. X    File:
  443. X        args.c
  444. X
  445. X167    Thursday Sept 17, 1987    Phil
  446. X    add else after doswitch in finger().
  447. X    add ttystate_t tiwait towait
  448. X    Files:
  449. X        args.c pr.h getcommand.c readpr.c
  450. X
  451. X170    Thursday October 29, 1987    Phil
  452. X    Flush zombies in getcommand()
  453. X    Files:
  454. X        getcommand.c
  455. X
  456. X171    Tuesday November 10, 1987    Phil
  457. X    Make compile on ULTRIX
  458. X    Split BSD4_3 defines into TTY_GROUP TTYENT TTY_REQUIRES_IOCTL
  459. X    Files:
  460. X        fingerd.c    getttytype.c    getttyloc    readpr.c
  461. X        getcommand.c    output.c    undomain.c    readttylocfile.c
  462. X
  463. X172    Friday November 13, 1987    Phil
  464. X    Move ttystate_t into ttystate.h (for Umax)
  465. X    Update for Umax 3.1.0; no more libu.a, no more statistics typedefs.
  466. X    Files:
  467. X        ttystate.h getcommand.c readpr.c finger.c getttyloc.c
  468. X        kmem.c names.c output.c pr.h read_vmunix.c ustruct.c
  469. X        ymakefile
  470. X
  471. X**** given to dle@csl.sri.com ****
  472. X
  473. X173    Tuesday Junuary 12, 1988    Phil
  474. X    Display 0:xx as 12:xxAM and 12:xx as 12:xxPM in nicetime.
  475. X    File:
  476. X        whois.c
  477. X
  478. X174    Wednesday January 13, 1988    Phil
  479. X    Port to IBM AIS 4.2 on PC/RT (ibm032);
  480. X    - use getdtablsize in fingerd.
  481. X    - Add L1 and N_SEGSIZ in read_vmunix.
  482. X    - Add VDEBUG in readpr.
  483. X    - Do awful things in ustruct.c
  484. X    Files:
  485. X        read_vmunix.c ustruct.c readpr.c fingerd.c
  486. X
  487. X175    Thursday January 14, 1988    Phil
  488. X    Add u_daemon enum in pr struct.  Fill in
  489. X    by tracing parents of current process in getcommand.
  490. X    Move body of getcommand to getcommand2. Display
  491. X    in getttyloc. Clean up readpr().
  492. X    Files:
  493. X        pr.h getcommand.c getttyloc.c readpr.c
  494. X
  495. X176    Saturday, January 23, 1988    Phil
  496. X    Create daemon struct in daemon.h.
  497. X    Create daemon table in daemon.c.
  498. X    Make u_daemon a short -- index into daemons[].
  499. X    Display daemon parantage without host (suntools)
  500. X    Recognize /dev/console as location "Console"
  501. X    Add suntools, vt100tool, othertools, dlogind(?) to known daemons.
  502. X    Files:
  503. X        ymakefile daemon.h daemon.c getttyloc.c readpr.c
  504. X
  505. X177    Wednesday, February 10, 1988    Phil
  506. X    Add ttwait and selwait check in getcommand.
  507. X    Display number of processes found in readpr.
  508. X    Files:
  509. X        getcommand.c readpr.c
  510. X
  511. X**** new version given to dle@csl.sri.com ****
  512. X**** given to winser@gnu.ai.mit.edu ****
  513. X
  514. X200    Wednesday, Feb 17, 1988    Phil
  515. X    Revamp autoconfig. Do DEFBANNER, TTYGROUP, TTYENT seperately
  516. X    Revamp taring in ymakefile. Include stuff dir.
  517. X    Move this to History.h. Create pversion.c
  518. X    File:
  519. X        autoconfig ymakefile History.h pversion.c
  520. X
  521. X201    Thursday, Feb 25, 1988    Phil
  522. X    Add u_daemonp to LUSER, make u_daemon a struct daemon *
  523. X    Files:
  524. X        luser.h daemon.h getcommand.c getttyloc.c
  525. X
  526. X202    Monday, March 7, 1988    Phil
  527. X    Define INIT_PID as 1, use in getcommand.c ttyask.c
  528. X    Use heuristic weighting in getcommand2()
  529. X    Create pr_weight
  530. X    Files:
  531. X        pr.h finger.h getcommand.c
  532. X
  533. X203    Tuesday March 8, 1988    Phil
  534. X    figure out signal states under Umax
  535. X    use valloc for mapping in readpr()
  536. X    rename ttystate etc to waitstate ...
  537. X    penalize gamescontrol (crocked for now)
  538. X    bonus for runnable
  539. X    finger.c no longer includes waitstate
  540. X    Files:
  541. X        ttystate.h -> waitstate.h
  542. X        finger.c getcommand.c readpr.c
  543. X
  544. X204    Thursday March 10, 1988    Phil
  545. X    Create enum and strings via _STATE and _STATES
  546. X    Create PAuse state and WAit state.
  547. X    Zero strings ends in names.c, alloc strings as VERSTRLEN+1
  548. X    Add _u to syms (for pause state)
  549. X    Files:
  550. X        waitstate.h readpr.c info.h names.c syms.h
  551. X
  552. X205    Tuesday, March 22, 1988 Phil
  553. X    Back from St. Lucia, W.I.
  554. X    Add officialhostname and OFFICIALhostname to args.c, use in undomain.c
  555. X    Other cleanup in undomain.c
  556. X    Handle X11 host:[:]display[.[screen]] madness in getttyloc.c
  557. X    Files:
  558. X        args.c undomain.c getttyloc.c
  559. X
  560. X206    Wednesday, March 23, 1988 Phil
  561. X    Add aliases islocalhost() to args.c, use in mcheck.c
  562. X    Add BOOL to finger.h
  563. X    Make strupcpy() and strzcpy() in strings.c return src (like strcpy)
  564. X    Fix LOG_ERROR to be LOG_ERR (for 4.3) in fingerd.c
  565. X    Files:
  566. X        args.c mcheck.c finger.h strings.c fingerd.c
  567. X
  568. X207    Monday, April 4, 1988    Phil
  569. X    Use mtime .ge. atime (was .gt.) in mcheck()
  570. X    File:
  571. X        mcheck.c
  572. X
  573. X210    Monday, April 10, 1988    Phil
  574. X    NETFOLLOW only when there are local users specified.
  575. X    Do remote users even if no local users were specified.
  576. X    (make just /follow work again)
  577. X    File:
  578. X        args.c
  579. X
  580. X211    Wednesday, April 20, 1988 Phil
  581. X    Call openlog with name "fingerd", use LOG_DAEMON if defined.
  582. X    Add HIDDEN_PROGRAMS for things like "gamescontrol"
  583. X    Files:
  584. X        fingerd.c getcommand.c
  585. X
  586. X212    Tuesday, May 3, 1988    Phil
  587. X    Add /state switch.
  588. X    Files:
  589. X        getcommand.c finger.c flags.h switch.c switch.h
  590. X
  591. X213    Saturday, May 6, 1988    Phil
  592. X    Have makeperson take luser as first arg.  This way we can
  593. X    finger personal name via inquire even if the yellow pages are
  594. X    dead!  Flush getperson1. Add REL_SUP.
  595. X    Files:
  596. X        getperson.c select.c finger.c
  597. X
  598. X214    Sunday, May 7, 1988    Phil
  599. X    If redirected console, display in default ttyloc.  Add /ITS
  600. X    (change nicetime, "Jobnam" header).  Display relation even if
  601. X    REL_SUP under /whois.  Add /output-idle -- displays time since
  602. X    last output.  Display groups in whois() -- Can get redundancies!!
  603. X    Files:
  604. X        getttyloc.c whois.c flags.h switch.c
  605. X        switch.h finger.c output.c
  606. X
  607. X215    Friday, May 13, 1988    Phil
  608. X    Port to Celerity (accel 3.4.x).  Make read_vmunix read NMAGIC
  609. X    files.  Capitalize first letter of uname inserted by '&' crock.
  610. X    Check for vaild u_procp in readpr().  Reuse t_short as long string
  611. X    if no ty_comment in readttyents().  Add PICKY.  Correct TTYENT
  612. X    ifdefs. Fix bsd4_3 quote problem in autoconfig.  Add accel to
  613. X    fingerd ARHITECTUREs.  Make Ultrix an ARCHITECTURE.  Add -L to ls
  614. X    /bin/write in autoconfig -- On accel its a symlink!
  615. X    Files:
  616. X        getperson.c getcommand.c getttyloc.c kmem.c read_vmunix.c
  617. X        readpr.c readttylocfile.c syms.h ustruct.c names.c
  618. X        autoconfig fingerd.c
  619. X
  620. X216    Tuesday, May 17, 1988    Phil
  621. X    Check for console redirection in getttyloc(). Add ISCONS macro.
  622. X    Add BIG_CONSOLE, SMALL_CONSOLE to tag lines.
  623. X    Add UID_NOBODY, USER_NOBODY to fingerd.
  624. X    Files:
  625. X        getttyloc.c fingerd.c
  626. X
  627. X217    Friday, May 20, 1988    Phil
  628. X    Add /process (sw_pid). Column not wide enough!!
  629. X    Files:
  630. X        finger.c flags.h switch.h switch.c
  631. X
  632. X220    Thursday, May 26, 1988    Phil (bucsf)
  633. X    Add NINQUIRE, inquire.h to support *NEW INQUIRE*
  634. X    Add P_NOPWENT to explicily flag users without password
  635. X    file entries (yp failure, stale inquire entry)
  636. X    Add s_next field to SELs for quick traversal.
  637. X    make ttyask timeouts be per question
  638. X    Files:
  639. X        person.h finger.c inquire.h ttyask.c getperson.c
  640. X        select.c select.h
  641. X
  642. X221    Monday, June 6, 1988 AM Phil (bucsf)
  643. X    Add MINCYCLE for ttycycle/ttyrandom.
  644. X    Cleanup in getcommand() and getcommand2().
  645. X    Add X10_STR/X11_STR to getttyloc()
  646. X    Add useinquire global.  Not yet checked *TODO*
  647. X    Use acct as supervisor,  Flush [maddr] display in whois.c
  648. X    Files:
  649. X        ttyask.c getcommand.c getttyloc.c args.c whois.c
  650. X
  651. X222    Monday, June 6, 1988 PM Phil (bucsf)
  652. X    Make finguser() table driven!!!
  653. X    File:
  654. X        finger.c
  655. X
  656. X223    Wednesday, June 8, 1988 Phil
  657. X    Rename /process to /pid. Document.  Create PID_COL:
  658. X    display pid in own column (crowds personal name) if defined.
  659. X    File:
  660. X        finger.c switch.h
  661. X
  662. X**************** Begin version 2
  663. X
  664. X300    Wednesday, June 15, 1988 Phil
  665. X    Prepped for Beta.  Updated all Copyrights, man page dates.
  666. X    Move DOC and SITE text into README.
  667. X    Kill locname.h move stuff to local.h, autoconfig.
  668. X    Make Install a sh file, preprocess with cpp (renamed Install.cpp)
  669. X    Fix day 1 bug in outchar (tab accounting (we do this twice!!)
  670. X    Files:
  671. X        COPYRIGHT Copying finger.1 ttyloc.1 nttyloc.5 fingerd.8c
  672. X        Install.cpp ymakefile Makefile
  673. X        autoconfig ttyloc.c locname.c output.c
  674. X
  675. X**** Beta release!!
  676. X
  677. X301    Wednesday, June 15, 1988 Phil
  678. X    Fix tar build to exclude SAMPLE*.h (avoid doubles)
  679. X    Invoke symdate and make-version with ./
  680. X        Allow supression of "same" (NEVER_SAME) (Fuat@columbia)
  681. X    Flush locname once and for all. Check for /usr/var under ultrix
  682. X        (mkhaw@teknowledge-vaxc.arpa)
  683. X    Allow suppression of "What" field (SUPPRESS_WHAT) (henry@garp)
  684. X    Files:
  685. X        Install.cpp ymakefile autoconfig finger.c
  686. X
  687. X302    Sunday, June 26, 1988 Phil
  688. X    Add ALWAYS_PRINT_HEADER, DONT_TAB_PLAN (fuat)
  689. X    Use LOADADDR on VAXen (Stu Grossman@Stanford)
  690. X    Create HZUP macro for hosts only, create PRESERVE_HOST_CASE (Stu)
  691. X    and uppercase[] table.  Use in zup, strupcpy.
  692. X    Print "No one logged in." when needed.
  693. X    Files:
  694. X        finger.c whois.c read_vmunix.c finger.h doremote.c
  695. X        getttyloc.c whois.c undomain.c string.c ymakefile
  696. X    New:
  697. X        upper.h upper.c
  698. X
  699. X303    Tuesday, July 6, 1988 Phil
  700. X    Ran thru comdef to comment all #else and #endifs (Fuat)
  701. X
  702. X304    Friday, July 8, 1988 Phil
  703. X    Monday, July 11
  704. X    Use fprintf for help, feed thru pager.
  705. X    Print copyright and version along with help.
  706. X    File:
  707. X        switch.c
  708. X
  709. X**** Second Beta release!!
  710. X
  711. X305    Monday, July 25, 1988 Phil
  712. X    rename PRESERVE_HOST_CASE to UPCASE_HOSTS and swap sense of test.
  713. X    (host case preservation is now the default)
  714. X    File:
  715. X        finger.h
  716. X
  717. X306    Wednesday, July 27, 1988 Phil
  718. X    Fix sense of ALWAYS_PRINT_HEADER.  Display last modification
  719. X    date of plan.  Add telnet.gw to daemons under ultrix
  720. X    Files:
  721. X        finger.c whois.c daemon.c
  722. X
  723. X307    Friday, July 29, 1988    Phil
  724. X    Sunday, July 31, 1988
  725. X    Port to SunOS 4.0 (sos4_0) on bu-pub a sun4
  726. X    Files:
  727. X        readpr.c ustruct.c getcommand.c syms.h pr.h
  728. X        autoconfig Install.cpp
  729. X
  730. X310    Monday, August 29, 1988    Phil
  731. X    Use kvm library under sos4_0
  732. X    (but not for struct proc, or nlist)
  733. X    Files:
  734. X        getcommand.c kmem.h names.c ustruct.c
  735. X        kmem.c readpr.c ymakefile
  736. X
  737. X311    Monday, September 19, 1988 Phil
  738. X    Various cleanup; add some forwards (thanks to gcc 1.25)
  739. X    Make edit 310 work on non SOS4.0. Use enum in ttyask.
  740. X    Files:
  741. X        ttyask.c ustruct.c ttyloc.c names.c
  742. X        getttyloc.c args.c
  743. X
  744. X312    Monday, October 24, 1988 Phil
  745. X    Check for pty named ttyv0 under Ultrix, remove leading
  746. X    pound sign and spaces from ttyent comments.  Add dtermd (?)
  747. X    to daemons list.
  748. X    Files:
  749. X        getttyloc.c readttylocfile.c daemon.c
  750. X
  751. X313    Wednesday, October 26, 1988 Phil
  752. X    Use switch in finger(). Add \ quoting. Don't stomp on prog.
  753. X    Increment sp after & copy loop in makeperson()
  754. X    Fix some Ultrix typos.
  755. X    Files:
  756. X        args.c getperson.c
  757. X        autoconfig daemon.c readttylocfile.c
  758. X
  759. X314    Saturday, November 12, 1988    Phil
  760. X    Port to Road Runner (sun 386i); Allow for alternate symbol
  761. X    forms under COFF.  Add cmdtool to daemons list (4.0 sunview?).
  762. X    read_vmunix does not yet understand COFF.  Add RR to fingerd.
  763. X    Detect NULL in pstr().  Chuck tp_long if NULL.
  764. X    Files:
  765. X        names.c syms.h info.h fingerd.c autoconfig
  766. X        daemon.c finger.c getttyloc.c
  767. X
  768. X315    Sunday, November 13, 1988    Phil
  769. X    Crock console stuff to work for 4.0.  Output consdev... under
  770. X    DEBUGSW.  Always output dev_t's in hex. Document consdev obs.
  771. X    Files:
  772. X        getcommand.c kmem.c readpr.c
  773. X
  774. X316    Tuesday, November 15, 1988    Phil
  775. X    Add selection_svc to list of hidden[].  Create IN_DOT_SERVER
  776. X    in case somone other than sun uses in.telnetd etc.  Flush
  777. X    sos4_0 in favor of SunOS >= 40.  Define KMEMREAD FTYPE
  778. X    ISBADFILE using kvm_t. Have symdate give real exit values.
  779. X    Files:
  780. X        getcommand.c daemon.c autoconfig daemon.c kmem.h
  781. X        kmem.c readpr.c ustruct.c fingerd.c pr.h syms.h
  782. X        getcommand.c symdate.c
  783. X
  784. Xmonths pass...
  785. X
  786. X317    Thursday, February 2, 1989    Phil
  787. X    Clean up in autoconfig. Use $T $RD etc for testing.
  788. X    Port to Ultrix 3.0; VOIDSIG (was SunOs >= 40), and P_TTYP.
  789. X    Add S_HELD for yux.
  790. X    Files:
  791. X        autoconfig readpr.c pr.h
  792. X
  793. X320    Thursday, February 16, 1989    Phil
  794. X    Clear lastpr in getcommand()
  795. X    File:
  796. X        getcommand.c
  797. X
  798. X321    Tuesday, February 22, 1989    Phil
  799. X    Fix ttyask symlink in Install.cpp
  800. X    File:
  801. X        Install.cpp
  802. X
  803. X322    Friday, March 3, 1989        Phil
  804. X    Port to Sony News. Very clean 4.3!!
  805. X    Punt in pstr before togoal()!
  806. X    Files:
  807. X        finger.c fingerd.c getttyloc.c read_vmunix.c
  808. X
  809. X323    Wednesday, April 26, 1989    Phil
  810. X    Back from the Yucatan, Mex.
  811. X    Update Copyrights again!  This time use GNU General
  812. X    Public Licence Version 1. RCS-ified (1.1)
  813. X    Files:
  814. X        The known world
  815. X
  816. X324    Wednesday, April 26, 1989    Phil
  817. X    Shorten KIT name for S5!
  818. X    File:
  819. X        ymakefile
  820. X
  821. X325    Sunday, May 21, 1989        Phil
  822. X    Port to DEC PMAX. Ran comdef on *.c. Removed UMAP1/2 code
  823. X    Files:
  824. X        ustruct.c read_vmunix.c fingerd.c
  825. X        autoconfig
  826. X
  827. X326    Monday, May 22, 1989        Phil
  828. X    Use h_errno, h_errlist to report errors!
  829. X    File:
  830. X        doremote.c
  831. X
  832. X327    Sunday, June 11, 1989        Phil
  833. X    Fix long standing bug with explicit finger of remotely logged
  834. X    8 character usernames(!)  in ent_select() found by
  835. X    composer@bucsf
  836. X    File:
  837. X        getent.c
  838. X
  839. X330    Monday, June 12, 1989        Phil
  840. X    Port to SGI/Iris.  First USG system with the necessary tools
  841. X    (job control and GNU Emacs)! myecho no longer needed.
  842. X    Files:
  843. X        Makefile acct.c getttyloc.c readpr.c autoconfig
  844. X        getut.c make-version switch.c finger.c info.h myecho.c
  845. X        syms.h fingerd.c kmem.c names.c getcommand.c kmem.h
  846. X        pr.h ustruct.c getent.c lastlog.c read_vmunix.c
  847. X        ymakefile ttyloc.c ttyask.c getent.c daemon.c
  848. X
  849. X    New:
  850. X        mywhoami.c uptime.c COMDEFALL DIFFALL
  851. X
  852. X331    Wednesday, June 14, 1989    Phil
  853. X    Port back from SGI Clean up system include files in
  854. X    readpr/getcommand/ustruct Compiles on SOS3, SOS4, SGI.  Defend
  855. X    against missing h_errno.  Add new daemon names for SGI.  Try
  856. X    to convert dotted octets to hostname or netname (checkhost).
  857. X    Lookup terminal location for last logout terminal.  If stdout
  858. X    not a terminal use unlimited output width.  Create strings.h
  859. X    to ease ports to other USG systems.
  860. X    Files:
  861. X        daemon.c doremote.c finger.c readpr.c undomain.c
  862. X        ustruct.c getcommand.c output.c readttylocfile.h
  863. X
  864. X    New:
  865. X        strings.h CHECKINALL
  866. X
  867. X332    Thursday, June 15, 1989        Phil
  868. X    Killed unused vars found with gcc -W.  What a compiler!
  869. X    Files:
  870. X        ttyask.c fingerd.c switch.c args.c readttylocfile.c
  871. X        readttylocfile.h kmem.c finger.c
  872. X
  873. X333    Tuesday, June 20, 1989        Phil
  874. X    Port to Umax V (Multimax System 5) -- Second USG system
  875. X    Clean up ttyloc.c, fingerd.c, PMAX/ultrix in ustruct.c
  876. X    More gcc induced cleanup (void and int function decls)
  877. X    Files:
  878. X        Makefile acct.c autoconfig doremote.c finger.c
  879. X        fingerd.c getcommand.c getttyloc.c kmem.c mcheck.c
  880. X        names.c output.c pr.h pversion.c readpr.c syms.h
  881. X        ttyloc.c ustruct.c ymakefile
  882. X    Renamed:
  883. X        readttylocfile.[ch] to ttylocfile.[ch]
  884. X
  885. X334    Wednesday, June 21, 1989    Phil
  886. X    Port back to VAX/4.3 and RT/4.3.  Use getpwnam for unmatched
  887. X    SELs under INQUIRE.  Add new switch /noinquire.  Add s_orig to
  888. X    SEL.  Add PUP telser daemon! Weight reduction in readpr and
  889. X    ustruct.  Always use p_addr, flushed MAP, HOG is default.  Use
  890. X    ioctls to get terminal width.  Add U_BADTTY to luser.  Keep
  891. X    last test version/date in README.
  892. X    Files:
  893. X        luser.h daemon.c finger.c output.c readpr.c
  894. X        select.[ch] switch.[ch] symsh.h ustruct.c README
  895. X        
  896. X
  897. X335    Thursday, June 22, 1989        Phil
  898. X    Update finger man page.  Start port to AIX/RT; autoconfig for
  899. X    SHORT_TTYP SYSLOG STREAMS SVR3_STATES PTYPATH PTS_PTY_NAMES.
  900. X    Set SHELL in Makefile! Handle TTY_WID/PER_WID differently.
  901. X    Move STD_{INPUT,OUTPUT} to finger.h. Always read padded
  902. X    ustruct from drum.
  903. X    Files:
  904. X        Makefile finger.h output.c switch.h autoconfig
  905. X        getcommand.c pr.h syms.h finger.1 getttyloc.c readpr.c
  906. X        ttyask.c finger.c names.c switch.c ustruct.c
  907. X
  908. X336    Sunday, June 25, 1989        Phil
  909. X    Use UNDERSCORE_NLIST_NAMES to determine nlist symbol flavor.
  910. X    Move make depend to Makefile, use cc -M; add cc-M from xrn11.
  911. X    Bring back usrpt lossage for ibm032 under NEED_USRPT.  Add
  912. X    NEED_USERMAP for non accel BSD systems.
  913. X    Files:
  914. X        finger.c getcommand.c names.c pr.h syms.h ustruct.c
  915. X        ymakefile Makefile autoconfig kmem.c readpr.c
  916. X
  917. X337    Tuesday, June 27, 1989        Phil
  918. X    Make /follow work locally (at long last!)
  919. X    Fix ttyloc.  Only CHECKINALL locked files!
  920. X    Files:
  921. X        args.c mcheck.c select.c CHECKINALL
  922. X
  923. X340    Sunday, July 9, 1989        Phil
  924. X    Port back to VAX Ultrix 3.0; Fix mail last read time.
  925. X    Files:
  926. X        ymakefile daemon.c finger.c getcommand.c
  927. X        mcheck.c output.c ustruct.c
  928. X
  929. X341    Wednesday, July 12, 1989    Phil
  930. X    Port back to Umax 4.2 (no ttyp).  Use ut_pid under S5 and
  931. X    kill(2) to verify utmp entries!  Works on sgi and Umax V.
  932. X    Files:
  933. X        getcommand.c getut.c
  934. X
  935. X342    Wednesday, July 26, 1989    Phil
  936. X    output \r in fingerd. ansify newmanifest. Add DONT_SAY_HACKING
  937. X    in whois(). make split uuencodes of compressed tar. Make
  938. X    net_name a routine. use h_addr_list, display Trying...  use
  939. X    net_name for remote fingers.
  940. X    Files:
  941. X        ymakefile fingerd.c newmanifest.c
  942. X        whois.c undomain.c doremote.c
  943. X
  944. X
  945. X343    Tuesday, August 1, 1989        Phil
  946. X    Now works on IBM PC-RT/AIX.  If /usr/mail exists use it.
  947. X    Files:
  948. X        ustruct.c autoconfig
  949. X
  950. X344    Saturday, September 9, 1989    Phil
  951. X    Check for NULL in pcount()
  952. X    File:
  953. X        finger.c
  954. X
  955. X345    Wednesday, November 15, 1989    Phil
  956. X    Add /noplan
  957. X    File:
  958. X        finger.c args.c flag.h switch.c switch.h finger.1
  959. X
  960. X346    Friday, December 1, 1989    Phil
  961. X    Update for Umax V 2.2g
  962. X    Files:
  963. X        autoconfig ustruct.c readpr.c
  964. X
  965. X347    ??? Phil
  966. X    Start working on per-user flags.
  967. X    Particularly force /match for local names in .forward!!
  968. X    Files:
  969. X        args.c doremote.c
  970. X
  971. X350    Friday, January 12, 1990    Phil
  972. X    Port to Interactive 386/ix SVR3.2; Put all ustruct include in
  973. X    ustruct.h; Check modes in autoconfig with checkmode.c
  974. X    Files:
  975. X        autoconfig Makefile ymakefile
  976. X        ustruct.c getcommand.c readpr.c 
  977. X    New:
  978. X        checkmode.c ustruct.h
  979. X
  980. X351    Friday, January 12, 1990    Phil
  981. X    Reimplement select.c using lists, flush select.h
  982. X    Implement per-user switches (only /match for now)
  983. X    Files:
  984. X        args.c select.c
  985. X    Flushed:
  986. X        select.h
  987. X
  988. X352    Friday, January 12, 1990    Phil
  989. X    Add struct flags to luser struct
  990. X    Do make depend while building xmakefile
  991. X    Files:
  992. X        finger.c getcommand.c getent.c getperson.c getttyloc.c
  993. X        luser.c mcheck.c output.c select.c whois.c whoj.c
  994. X        Makefile ymakefile
  995. X
  996. X353    Tuesday, January 30, 1990    Phil
  997. X    Flush args.m4, etc, rename flags struct, Flags to
  998. X    switches, Sw.  Remove old inquire (and INQUIRE define).
  999. X    Major cleanup in select.c
  1000. X    Flushed:
  1001. X        args.m4 flags.h
  1002. X    New:
  1003. X        args.h    
  1004. X    Files:
  1005. X        ymakefile args.c finger.c getent.c getttyloc.c inquire.h
  1006. X        inquire.c luser.h mcheck.c select.c switch.c finger.1
  1007. X
  1008. X354    Tuesday, April 24, 1990    Phil
  1009. X    Only make depend when building programs. Added DEPEND hack.
  1010. X    Fix kit/dist. Update Copyrights to 1990, remove some
  1011. X    boilerplate, use RCS Id rather than Header. Ran COMDEFALL.
  1012. X    Checked in as RCS version 2.0
  1013. X    Files:
  1014. X        Makefile ymakefile README autoconfig
  1015. X
  1016. X355    Wednesday, April 25, 1990 3AM    Phil
  1017. X    Touchups for UmaxV and AIX
  1018. X    Files:
  1019. X        Makefile ymakefile autoconfig readpr.c ustruct.h cc-M
  1020. X
  1021. X356    Wednesday, April 25, 1990 6PM    Phil
  1022. X    Touchups for SGI/Irix and Ultrix 3.1 (per jdh)
  1023. X    Files:
  1024. X        ustruct.c ustruct.h output.c getttyloc.c
  1025. X
  1026. X357    Wednesday, April 25, 1990 8PM    Phil
  1027. X    Moved make depend work back to x/ymakefile
  1028. X    Files:
  1029. X        Makefile ymakefile
  1030. X
  1031. X360    Thursday, April 26, 1990 -
  1032. X    Wednesday, May 2, 1990        Phil
  1033. X    Fixes to Install.cpp from spike@world.std.com;
  1034. X    Implement finger.conf file!!
  1035. X    Flushed:
  1036. X        acct.c
  1037. X    New:
  1038. X        conf.c finger.conf.5 finger.conf
  1039. X    Files:
  1040. X        Install.cpp Makefile args.c autoconfig doremote.c
  1041. X        finger.c getcommand.c getperson.c output.c undomain.c
  1042. X        whois.c ymakefile
  1043. X
  1044. X361    Tuesday, May 8, 1990        Phil
  1045. X    Port to SunOS 4.1, Make SunOS define 3 digits!!
  1046. X    Files:
  1047. X        autoconfig daemon.c fingerd.c getcommand.c getttyloc.c
  1048. X        kmem.c kmem.h luser.h output.c pr.h readpr.c syms.h
  1049. X        ustruct.c ustruct.h README
  1050. X
  1051. X362    Thursday, May 17, 1990        Phil
  1052. X    Port to Sequent S3, add ORIG to kit.
  1053. X    New:
  1054. X        ORIG
  1055. X    Files:
  1056. X        DIFFALL README autoconfig fingerd.c read_vmunix.c
  1057. X        ustruct.c ymakefile
  1058. X
  1059. X363    Friday, May 18, 1990        Phil
  1060. X    Port back to Celerity, cleanup fingerd
  1061. X    Files:
  1062. X        autoconfig fingerd.c README
  1063. X
  1064. X364    Sunday, May 20, 1990        Phil
  1065. X    Define Umax as 42 or 43 in preparation for release 4.0
  1066. X    Use stat of /dev/tty15 in onlat(). Define and use AIX_RT
  1067. X    Files:
  1068. X        autoconfig fingerd.c getcommand.c getttyloc.c kmem.c
  1069. X        names.c read_vmunix.c readpr.c ustruct.c ustruct.h
  1070. X
  1071. X365    Monday, May 21, 1990 -
  1072. X    Monday, June 4, 1990        Phil
  1073. X    Port to AIX3 on the IBM RS/6000
  1074. X    Files:
  1075. X        args.c autoconfig daemon.c finger.c fingerd.c getcommand.c
  1076. X        getttyloc.c output.c readpr.c ustruct.c ustruct.h whois.c
  1077. X        ymakefile
  1078. X
  1079. X366    Tuesday, May 29, 1990 -
  1080. X    Monday, June 4, 1990        Phil
  1081. X    Merge back changes for AIX 1.1 PS/2 port.
  1082. X    Have not tested ustruct2() code. Add "make quick"
  1083. X    Files:
  1084. X        Makefile autoconfig fingerd.c getut.c ustruct.c ustruct.h
  1085. X
  1086. X367    Thursday, June 14, 1990        Phil
  1087. X    Port to Umax 4.3 (rel 4.0).
  1088. X    Files:
  1089. X        autoconfig getcommand.c output.c
  1090. X        read_vmunix.c readpr.c ustruct.c ymakefile
  1091. X
  1092. X
  1093. X370    Friday, June 29, 1990        Phil
  1094. X    Fix display of last login host.  Do checkhost() in lltime(),
  1095. X    pass back host flag to prevent tty line lookup!!  If local
  1096. X    host is a suffix of remote host remove entire thing!!  Change
  1097. X    " Account: " display to " Group: ".
  1098. X    Files:
  1099. X        undomain.c lastlog.c finger.c
  1100. X
  1101. X**************** Start version 3
  1102. X
  1103. X400    Friday, July 6, 1990        Phil
  1104. X    Ran COMDEF, checked all files in as 3.0
  1105. X    Status "Rel", tag "rel1"
  1106. X
  1107. X**************** released to comp.sources.unix
  1108. X
  1109. X******** DONT FORGET TO UPDATE VERSION NUMBER BELOW!! (IN OCTAL) ********/
  1110. X
  1111. Xstruct _JBVER ver = { 0, 03, 0, 0400 };    /* who, major, minor, edit */
  1112. END_OF_History.h
  1113. if test 31479 -ne `wc -c <History.h`; then
  1114.     echo shar: \"History.h\" unpacked with wrong size!
  1115. fi
  1116. # end of overwriting check
  1117. fi
  1118. if test -f getttyloc.c -a "${1}" != "-c" ; then 
  1119.   echo shar: Will not over-write existing file \"getttyloc.c\"
  1120. else
  1121. echo shar: Extracting \"getttyloc.c\" \(16826 characters\)
  1122. sed "s/^X//" >getttyloc.c <<'END_OF_getttyloc.c'
  1123. X/*
  1124. X * getttyloc.c -- get tty location for finger (December 1985)
  1125. X *
  1126. X * Copyright (C) 1988, 1990  Philip L. Budne
  1127. X *
  1128. X * This file is part of "Phil's Finger Program".
  1129. X *
  1130. X * This program is free software; you can redistribute it and/or modify
  1131. X * it under the terms of the GNU General Public License as published by
  1132. X * the Free Software Foundation; either version 1, or (at your option)
  1133. X * any later version.
  1134. X *
  1135. X */
  1136. X
  1137. X# ifndef lint
  1138. Xstatic char *rcsid = "$Id: getttyloc.c,v 3.0 90/07/06 13:10:53 budd Rel $";
  1139. X# endif /* lint not defined */
  1140. X
  1141. X/*
  1142. X *    This is pretty ad hoc and ugly.  To add a new flavor of
  1143. X *    display you need to take care of two cases; With and without
  1144. X *    user string (long and short displays)
  1145. X *
  1146. X *    TODO:
  1147. X *
  1148. X *    User ttylocs are stored per tty in a spool area.  Having the
  1149. X *    user strings stored in a file containing an array of structs,
  1150. X *    would save disk space.
  1151. X *
  1152. X *    Keeping ALL information (default short, long; current short,
  1153. X *    long) in a central, binary file would save CPU in addition.
  1154. X *    This way random programs (ie; supdup) could get the correct,
  1155. X *    full ttyloc.
  1156. X *
  1157. X *    This could be done without tracking logins by date stamping
  1158. X *    the user set and login dependant info (host, network, deamon)
  1159. X *    The finger and ttyloc could update entries via set gid access.
  1160. X *    (requies file and/or record locking?)
  1161. X *
  1162. X *    Use sprintf less!!
  1163. X *
  1164. X *    Could search cdevsw for ltaopen and ptcopen rather than using
  1165. X *    LATPATH and PTYPATH
  1166. X */
  1167. X
  1168. X# ifndef X10_STR
  1169. X# define X10_STR "X10"            /* if no "screen" number */
  1170. X# endif /* X10_STR not defined */
  1171. X
  1172. X# ifndef X11_STR
  1173. X# define X11_STR "X"            /* if have "screen" number */
  1174. X# endif /* X11_STR not defined */
  1175. X
  1176. X# include <sys/types.h>
  1177. X# include <sys/stat.h>
  1178. X# include <strings.h>
  1179. X# include <ctype.h>
  1180. X# include <stdio.h>
  1181. X# include "finger.h"
  1182. X# include "person.h"
  1183. X# include "args.h"            /* before luser.h */
  1184. X# include "luser.h"
  1185. X# include "ttylocfile.h"
  1186. X# include "daemon.h"
  1187. X# include "pr.h"
  1188. X
  1189. X# ifdef USG
  1190. X# include <sys/sysmacros.h>        /* for major() macro */
  1191. X# endif /* USG defined */
  1192. X
  1193. X# ifdef ultrix
  1194. X# ifdef USE_DEVIOCGET
  1195. X# include <sys/file.h>
  1196. X# include <sys/ioctl.h>
  1197. X# include <sys/devio.h>
  1198. X# else  /* USE_DEVIOCGET not defined */
  1199. XLOCAL int latmajor = -1;
  1200. X# define LATPATH "/dev/tty15"
  1201. X# endif /* USE_DEVIOCGET not defined */
  1202. X# endif /* ultrix defined */
  1203. X
  1204. X# ifndef DEFAULT_DAEMON
  1205. X# define DEFAULT_DAEMON "Virtual Terminal" /* NVT (host but no daemon found) */
  1206. X# endif /* DEFAULT_DAEMON not defined */
  1207. X
  1208. X/* for console window on Suns */
  1209. X# ifndef SMALL_CONSOLE
  1210. X/* # define SMALL_CONSOLE " [cons]"    /**/
  1211. X# define SMALL_CONSOLE " [console]"    /* enuf room for this! */
  1212. X# endif /* SMALL_CONSOLE not defined */
  1213. X
  1214. X# ifndef BIG_CONSOLE
  1215. X# define BIG_CONSOLE " [console]"
  1216. X# endif /* BIG_CONSOLE not defined */
  1217. X
  1218. X# ifndef PTYPATH
  1219. X# define PTYPATH "/dev/ttyp1"        /* path for known pty-tty */
  1220. X# endif /* PTYPATH not defined */
  1221. X
  1222. X# ifdef Umax
  1223. X# include <netdb.h>            /* for struct hostent */
  1224. X# include <sys/socket.h>        /* for AF_INET */
  1225. X# endif /* Umax defined */
  1226. X
  1227. X# define USERLEN 32            /* max length of user string */
  1228. X# define LOCLEN 48            /* max length of ttyloc string */
  1229. X
  1230. XLOCAL char location[LOCLEN];        /* return value goes here */
  1231. XLOCAL char userstr[USERLEN];        /* user string (if any) here */
  1232. XLOCAL int ptymajor = -1;        /* major device number for tty/pty */
  1233. XLOCAL int readfile;            /* ture if we have read LOCFILE */
  1234. X
  1235. XEXTERN char *zup(), *cleanup();        /* from string.c */
  1236. XEXTERN char *locname();            /* from locname.c */
  1237. XEXTERN char *netlocname();        /* from locname.c */
  1238. X
  1239. X# ifdef sun
  1240. XEXTERN dev_t consdev, rconsdev;        /* current and real console devs */
  1241. X# define ISCONS(d) (d == consdev && consdev != rconsdev)
  1242. X# else  /* sun not defined */
  1243. X# define ISCONS(d) 0            /* smart compilers will remove this */
  1244. X# endif /* sun not defined */
  1245. X
  1246. XLOCAL BOOL onapty( u )
  1247. X    LUSER *u;
  1248. X{
  1249. X    struct stat stb;
  1250. X
  1251. X    if( ptymajor == -1 ) {        /* first time? */
  1252. X    if( stat(PTYPATH, &stb) == 0 )
  1253. X        ptymajor = major( stb.st_rdev );
  1254. X    else {
  1255. X        ptymajor = -2;
  1256. X        return( FALSE );
  1257. X    }
  1258. X    } /* first time? */
  1259. X
  1260. X    if( ptymajor > 0 && ptymajor == major( u->u_ttydev ) )
  1261. X    return( TRUE );
  1262. X    return( FALSE );
  1263. X} /* onapty */
  1264. X
  1265. X# ifdef ultrix
  1266. XLOCAL BOOL onlat( u )
  1267. X    LUSER *u;
  1268. X{
  1269. X# ifdef USE_DEVIOCGET
  1270. X/* This is soooo dumb.
  1271. X * - Requires a fd (so only works when have write access to ttys!)
  1272. X * - returns *STRINGS*
  1273. X * - **FAILS** on pty's (Not a typewriter!)
  1274. X *
  1275. X * What twinkies.
  1276. X *
  1277. X * This will only be of any use if finger runs setuid to root.
  1278. X * (setgid group tty is pointless, since finger needs group kmem
  1279. X * as well).  This is not (known to be) dangerous, just tasteless!
  1280. X *
  1281. X * Probably better to just put all LAT lines (!) into /etc/(n)ttyloc.
  1282. X */
  1283. X    int fd, flag;
  1284. X    char path[ 32 ];
  1285. X    struct devget dg;
  1286. X    static int checked = FALSE, notty = FALSE;
  1287. X
  1288. X    strcpy( path, "/dev/" );
  1289. X    strcat( path, u->u_line );
  1290. X
  1291. X    if( !checked ) {            /* check if we have a tty */
  1292. X    if( (f = open( "/dev/tty", 1)) >= 0 )
  1293. X        close( f );            /* yes we do */
  1294. X    else
  1295. X        notty = TRUE;        /* we don't */
  1296. X    checked = TRUE;
  1297. X    }
  1298. X
  1299. X    if( (fd = open (argv[i], O_RDONLY|O_NDELAY)) < 0 &&
  1300. X       (fd = open (argv[i], O_WRONLY|O_NDELAY)) < 0 )
  1301. X    return( FALSE );
  1302. X
  1303. X    flag = ioctl( fd, DEVIOCGET, &dg ) == 0 &&
  1304. X    strcmp( dg.interface, DEV_LAT ) == 0;
  1305. X
  1306. X    (void) close( fd );
  1307. X
  1308. X    /* flush tty association -- so fingerd doesn't get attached!! */
  1309. X    if( notty && (fd = open( "/dev/tty", 1)) >= 0 ) { /* if no tty */
  1310. X    ioctl( fd, TIOCNOTTY, 0 );    /* flush assoc with one */
  1311. X    close( f );            /* we just opened */
  1312. X    }
  1313. X
  1314. X    return( flag );
  1315. X# else  /* USE_DEVIOCGET not defined */
  1316. X    if( latmajor == -1 ) {        /* first time? */
  1317. X    if( stat(LATPATH, &stb) == 0 )
  1318. X        latmajor = major( stb.st_rdev );
  1319. X    else {
  1320. X        latmajor = -2;
  1321. X        return( FALSE );
  1322. X    }
  1323. X    } /* first time? */
  1324. X
  1325. X    if( latmajor > 0 && latmajor == major( u->u_ttydev ) )
  1326. X    return( TRUE );
  1327. X    return( FALSE );
  1328. X# endif /* USE_DEVIOCGET not defined */
  1329. X} /* onlat */
  1330. X# endif /* ultrix defined */
  1331. X
  1332. XGLOBAL void inittylocs() {
  1333. X    if( !readfile ) {
  1334. X    readfile = 1;
  1335. X    if( readnewttylocfile() < 1 ) {
  1336. X        int i;
  1337. X        i = readttylocfile();
  1338. X# ifdef TTYENT
  1339. X        if( i < 1 )
  1340. X        i = readttyents();
  1341. X# endif /* TTYENT defined */
  1342. X    }
  1343. X    } /* try reading a ttyloc file */
  1344. X} /* inittylocs */
  1345. X
  1346. XGLOBAL char *getttyloc( u )        /* return ttyloc string */
  1347. X    LUSER *u;
  1348. X{
  1349. X    int f, cc;            /* file */
  1350. X    char *fname, *shortstr, *longstr;
  1351. X    TTYLOC *tp;
  1352. X
  1353. X    userstr[0] = EOS;
  1354. X    if( !readfile )
  1355. X    inittylocs();
  1356. X
  1357. X    if( !u->u_sw.sw_location ) {
  1358. X    fname = locname(u->u_line); /* try to find file in spool area */
  1359. X    if( (f = open(fname, 0)) >= 0 ) {
  1360. X        struct stat stb;
  1361. X        if( fstat(f, &stb) == 0 && stb.st_mtime > u->u_time ) {
  1362. X# ifdef DEBUG
  1363. X        puts(fname);
  1364. X# endif /* DEBUG defined */
  1365. X        cc = read(f, userstr, USERLEN-1);
  1366. X        if( cc > 0 )
  1367. X            userstr[cc] = EOS;
  1368. X        } /* fstat and recent */
  1369. X        close(f);
  1370. X        cleanup(userstr);
  1371. X    } /* fname open */
  1372. X
  1373. X# ifdef OTTYLOC                /* old style per user ttyloc */
  1374. X    /* try ~/.ttyloc file -- this could be cached in the luser struct */
  1375. X    if( userstr[0] == EOS && u->u_person != NULL) {
  1376. X        strcpy(fname, u->u_person->p_home);
  1377. X        strcat(fname, "/.ttyloc");
  1378. X        if( (f = open(fname, 0)) >= 0 ) {
  1379. X        cc = read(f, userstr, USERLEN-1);
  1380. X        userstr[cc] = EOS;
  1381. X        }
  1382. X        close(f);
  1383. X        cleanup(userstr);
  1384. X    } /* no userstr yet, have person */
  1385. X# endif /* OTTYLOC defined */
  1386. X    } /* not sw_location */
  1387. X
  1388. X    shortstr = longstr = NULL;
  1389. X
  1390. X    if( u->u_host[0] != EOS )
  1391. X    checkhost( u->u_host, sizeof( u->u_host ) );
  1392. X# ifdef Umax
  1393. X     else if( u->u_ttyaddr != 0 ) {
  1394. X    struct hostent *hp;
  1395. X    if( (hp = gethostbyaddr( &u->u_ttyaddr,
  1396. X                sizeof( u->u_ttyaddr ), AF_INET )) != NULL )
  1397. X        strzcpy( u->u_host, hp->h_name, sizeof( u->u_host ) - 1 );
  1398. X    else
  1399. X        strzcpy( u->u_host, inet_ntoa( u->u_ttyaddr ) );
  1400. X    } /* no host */
  1401. X# endif /* Umax defined */
  1402. X
  1403. X    if( u->u_host[0] != EOS ) {        /* have host? */
  1404. X    register char *cp;
  1405. X
  1406. X# ifndef NO_X_WINDOWS
  1407. X    int display_number, decnet_display, screen_number;
  1408. X# define NOT_FOUND -1
  1409. X    display_number = screen_number = NOT_FOUND;
  1410. X
  1411. X    /* This botches on XNS addresses net:addr */
  1412. X    if( (cp = index(u->u_host, ':')) != NULL ) { /* host:display */
  1413. X        *cp++ = EOS;        /* blast first ':' */
  1414. X
  1415. X        if( *cp == ':' ) {        /* second ':' ? (DECnet) */
  1416. X        cp++;            /* advance. */
  1417. X        decnet_display = TRUE;
  1418. X        } /* second ':' */
  1419. X        else
  1420. X        decnet_display = FALSE;
  1421. X
  1422. X        if( isdigit( *cp ) ) {    /* digits after ':'? */
  1423. X        display_number = 0;
  1424. X        do
  1425. X            display_number = display_number * 10 + *cp++ - '0';
  1426. X        while( isdigit(*cp) );
  1427. X
  1428. X        if( *cp == '.' ) {    /* display terminated by DOT? */
  1429. X            screen_number = 0;    /* X11 "screen number" */
  1430. X            cp++;        /* skip dot */
  1431. X
  1432. X            while( isdigit(*cp) )
  1433. X            screen_number = screen_number * 10 + *cp++ - '0';
  1434. X        } /* collect screen */    
  1435. X        } /* digits after ':' */
  1436. X    } /* found : */
  1437. X# endif /* NO_X_WINDOWS not defined */
  1438. X
  1439. X    if( userstr[0] != EOS ) {    /* have user str? */
  1440. X        undomain( u->u_host, TRUE ); /* remove domains and prefixes */
  1441. X
  1442. X        longstr = userstr;
  1443. X        shortstr = NULL;
  1444. X
  1445. X# ifndef NO_X_WINDOWS
  1446. X        if( display_number != NOT_FOUND ) {
  1447. X        char screen[ 15 ];
  1448. X        if( screen_number != NOT_FOUND && screen_number != 0 )
  1449. X            sprintf( screen, ".%d", screen_number );
  1450. X        else
  1451. X            screen[0] = EOS;
  1452. X
  1453. X        sprintf(location, "%s:%s%d%s",
  1454. X            u->u_host,
  1455. X            (decnet_display ? ":" : ""),
  1456. X            display_number,
  1457. X            screen );
  1458. X        shortstr = location;
  1459. X        } /* display != -1 */
  1460. X# endif /* NO_X_WINDOWS not defined */
  1461. X# ifdef Umax
  1462. X        else if( u->u_ttyaddr != 0 ) {
  1463. X        register int i;
  1464. X        char *lt;
  1465. X        static char *ltt[] = {
  1466. X            "", "lp",        /* BSD style driver */
  1467. X            "V", "Vlp" };    /* SYSV style */
  1468. X
  1469. X        i = u->u_ttytype;
  1470. X        if( i < 1 || i-1 > ( sizeof( ltt ) / sizeof( char * ) ) )
  1471. X            lt = "??";
  1472. X        else
  1473. X            lt = ltt[ i-1 ];
  1474. X        sprintf(location, "%s_%s%d", /* A la ANF-10 !*/
  1475. X            HZUP( u->u_host ),
  1476. X            lt,
  1477. X            u->u_ttynum );
  1478. X        shortstr = location;
  1479. X        } /* ttyaddr != 0 */
  1480. X# endif /* Umax defined */
  1481. X# ifdef ultrix
  1482. X        else if( onlat( u ) )
  1483. X        shortstr = "LAT";
  1484. X# endif /* ultrix defined */
  1485. X        else
  1486. X        shortstr = HZUP( u->u_host );
  1487. X    } /* host and user str */
  1488. X    else {                /* host, no user string */
  1489. X        undomain( u->u_host, FALSE ); /* just remove domains */
  1490. X# ifndef NO_X_WINDOWS
  1491. X        if( display_number != NOT_FOUND ) { /* have x display number */
  1492. X        char screen[ 15 ], *xv;    /* X11 */
  1493. X        screen[0] = EOS;
  1494. X        xv = X10_STR;
  1495. X        if( screen_number != NOT_FOUND ) {
  1496. X            xv = X11_STR;
  1497. X            if( screen_number != 0 )
  1498. X            sprintf( screen, " screen %d",
  1499. X                screen_number ); /* woof */
  1500. X        }
  1501. X# ifdef X_LOCAL
  1502. X        if( casecmp( u->u_host, "UNIX" ) )
  1503. X            sprintf( location, "Local %s display %d%s%s",
  1504. X                xv, display_number, screen,
  1505. X                (ISCONS(u->u_ttydev) ? SMALL_CONSOLE : "") );
  1506. X        else
  1507. X# endif /* X_LOCAL defined */
  1508. X            sprintf(location, "%s (%s%s display %d%s)%s",
  1509. X                u->u_host,    /* zup'ed already */
  1510. X                (decnet_display ? "DECnet " : ""), /* we use TCP */
  1511. X                xv, display_number, screen,
  1512. X                (ISCONS(u->u_ttydev) ? SMALL_CONSOLE : "") );
  1513. X        return( location );
  1514. X        } /* have display number */
  1515. X        else
  1516. X# endif /* NO_X_WINDOWS not defined */
  1517. X# ifdef Umax
  1518. X        if( u->u_ttyaddr != 0 ) {    /* host, no user, is annex device */
  1519. X        register int i;
  1520. X        char *lt;
  1521. X        static char *ltt[] = {
  1522. X            "port", "lp",    /* BSD devices */
  1523. X            "Vport", "SYSV lp"    /* SYS V devices */
  1524. X            };
  1525. X
  1526. X# ifdef NETLOC
  1527. X        int f;
  1528. X        char portname[ 50 ];
  1529. X
  1530. X        sprintf( portname, "%s:port%d", u->u_host, u->u_ttynum );
  1531. X        fname = netlocname( portname );
  1532. X        if( (f = open(fname, 0)) >= 0 ) {
  1533. X            struct stat stb;
  1534. X            if( fstat(f, &stb) == 0 && stb.st_mtime > u->u_time ) {
  1535. X            cc = read(f, userstr, USERLEN-1);
  1536. X            userstr[cc] = EOS;
  1537. X            }
  1538. X            close(f);
  1539. X            cleanup(userstr);
  1540. X            if( userstr[0] != EOS )
  1541. X            return( userstr );
  1542. X        } /* open ok */
  1543. X# endif /* NETLOC defined */
  1544. X
  1545. X        i = u->u_ttytype;
  1546. X        if( i < 1 || i-1 > ( sizeof( ltt ) / sizeof( char * ) ) )
  1547. X            lt = "??";
  1548. X        else
  1549. X            lt = ltt[ i-1 ];
  1550. X
  1551. X        sprintf(location, "%s (Annex Call) %s%d",
  1552. X            HZUP( u->u_host ),
  1553. X            lt,
  1554. X            u->u_ttynum );
  1555. X        return( location );
  1556. X        } /* host, no user str, is annex */
  1557. X        else
  1558. X# endif /* Umax defined */
  1559. X# ifdef ultrix
  1560. X        else if( onlat( u ) ) {    /* host, no user str, LAT */
  1561. X        sprintf( location, "%s (LAT)", HZUP( u->u_host ) );
  1562. X        return( location );
  1563. X        } /* host, no user str, LAT */
  1564. X# endif /* ultrix defined */
  1565. X        {                /* host, nothing unusual */
  1566. X        char *dp;
  1567. X        if( u->u_daemon != NULL )
  1568. X            dp = u->u_daemon->d_long;
  1569. X        else if( u->u_daemonp != NULL &&
  1570. X            u->u_daemonp->pr_cmd[0] != EOS )
  1571. X            dp = u->u_daemonp->pr_cmd;
  1572. X        else
  1573. X            dp = DEFAULT_DAEMON;
  1574. X        sprintf( location, "%s (%s)", HZUP( u->u_host ), dp );
  1575. X        return( location );
  1576. X        } /* host, nothing unusual */
  1577. X    } /* host, no user string */
  1578. X    } /* have host */
  1579. X    else if( onapty( u ) ) {        /* is pty, no host */
  1580. X    if( userstr[0] != EOS ) {    /* pty, no host, user string */
  1581. X        if( u->u_daemon != NULL )
  1582. X        shortstr = u->u_daemon->d_short;
  1583. X        else if( u->u_daemonp != NULL &&
  1584. X            u->u_daemonp->pr_cmd[0] != EOS )
  1585. X        shortstr = u->u_daemonp->pr_cmd;
  1586. X        else if( ISCONS(u->u_ttydev) )
  1587. X        shortstr = "CONS";
  1588. X        else
  1589. X        shortstr = "PTY";    /* sigh */
  1590. X        longstr = userstr;
  1591. X    } /* pty, nohost, user string */
  1592. X    else if( u->u_daemon != NULL ) { /* pty, nohost, nouser, daemon */
  1593. X        char *cons;
  1594. X        if( ISCONS(u->u_ttydev) )    /* pty nohost nouser daemon cons */
  1595. X            cons = SMALL_CONSOLE;
  1596. X        else
  1597. X            cons = "";
  1598. X        sprintf( location, "via %s%s", u->u_daemon->d_long, cons );
  1599. X        return( location );
  1600. X    } /* pty, nohost, nouser, daemon entry */
  1601. X    else if( u->u_daemonp != NULL && u->u_daemonp->pr_cmd[0] != EOS ) {
  1602. X        /* pty, nohost, nouser, daemon process (not in daemon table) */
  1603. X        char *cons;
  1604. X        if( ISCONS(u->u_ttydev) )
  1605. X        cons = BIG_CONSOLE;
  1606. X        else
  1607. X        cons = "";
  1608. X        sprintf( location, "child of %s%s", u->u_daemonp->pr_cmd, cons );
  1609. X        return( location );
  1610. X    } /* pty, nohost, nouser, daemon process */
  1611. X    else if( ISCONS(u->u_ttydev) )    /* pty, nohost, nouser, nodaemon, con*/
  1612. X        return( "Pseudo Console" );
  1613. X# ifndef NO_X_WINDOWS
  1614. X    else if( strcmp( u->u_line, "ttyv0" ) == 0 )
  1615. X        return( "X login window");
  1616. X# endif /* NO_X_WINDOWS not defined */
  1617. X    else                /* pty, nohost, nouser, nodae, nocon */
  1618. X        return( "Pseudo Terminal" );
  1619. X    } /* is pty */
  1620. X# ifdef ultrix
  1621. X    else if( onlat( u ) ) {        /* no host, LAT */
  1622. X    if( userstr[0] == EOS )        /* LAT, no host, no userstr */
  1623. X        return( "via LAT" );
  1624. X    else
  1625. X        shortstr = "LAT";
  1626. X    } /* LAT, no host */
  1627. X# endif /* ultrix defined */
  1628. X    else {                /* normal line (no host, no pty) */
  1629. X# ifdef NETLOC
  1630. X    if( userstr[0] == EOS ) {    /* normal line, no userstr */
  1631. X        fname = netlocname(u->u_line); /* try to find file in spool area */
  1632. X        f = open( fname, 0 );
  1633. X        if( f >= 0 ) {
  1634. X        struct stat stb;
  1635. X        if( fstat(f, &stb) == 0 && stb.st_mtime > u->u_time ) {
  1636. X            cc = read(f, userstr, USERLEN-1);
  1637. X            userstr[cc] = EOS;
  1638. X        }
  1639. X        close(f);
  1640. X        cleanup( userstr );
  1641. X        } /* opened file */
  1642. X    } /* no userstr */
  1643. X# endif /* NETLOC defined */
  1644. X
  1645. X    if( (tp = findttyloc( u->u_line )) != NULL ) { /* get from file */
  1646. X        if( userstr[0] != EOS ) {    /* found ttyloc, have userstr */
  1647. X        shortstr = tp->t_short;
  1648. X        longstr = userstr;
  1649. X        } /* found ttyloc, have userstr */
  1650. X        else if( tp->t_locn != NULL )
  1651. X        return( tp->t_locn );
  1652. X        /* fall back on t_short??? WISH */
  1653. X    } /* found tp entry */
  1654. X# ifdef UmaxV
  1655. X    else if( u->u_line[0] == 'r' && u->u_line[1] == 't' ) {
  1656. X        /* mls rdp device; rtAAPPSS */
  1657. X        if( userstr[0] == EOS ) {
  1658. X        if( strlen( u->u_line ) == 7 ) {
  1659. X            char session[ 10 ];
  1660. X            
  1661. X            if( u->u_line[6] != '0' )
  1662. X            sprintf( session, " session %c",
  1663. X                u->u_line[6] );
  1664. X            else
  1665. X            session[0] = EOS;
  1666. X
  1667. X            sprintf( location, "annex %c%c port %c%c%s",
  1668. X                u->u_line[2], u->u_line[3],
  1669. X                u->u_line[4], u->u_line[5],
  1670. X                session );
  1671. X            return( location );
  1672. X        }
  1673. X        else
  1674. X            return( "annex RDP connection" );
  1675. X        }
  1676. X        else
  1677. X        shortstr = "annex";    /* "RDP" */
  1678. X
  1679. X    }
  1680. X    else if( u->u_line[0] == 'R' && u->u_line[1] == 'T' ) {
  1681. X        /* mls rdp device RTxxxxx for unknown annex */
  1682. X        if( userstr[0] == EOS ) {
  1683. X        sprintf( location, "foreign annex %s",
  1684. X            u->u_line+2 );
  1685. X        return( location );
  1686. X        }
  1687. X        else
  1688. X        shortstr = "annex";
  1689. X    }
  1690. X# endif /* UmaxV defined */
  1691. X    else if( userstr[0] != EOS )
  1692. X        return( userstr );
  1693. X    } /* normal line (no host, no user) */
  1694. X
  1695. X    if( longstr == NULL ) {
  1696. X    if( strcmp( u->u_line, "console" ) == 0
  1697. X# ifdef AIX3
  1698. X        || strcmp( u->u_line, "hft/1" ) == 0
  1699. X# endif /* AIX3 defined */
  1700. X        )
  1701. X        longstr = "Console Terminal"; /* physical console */
  1702. X    }
  1703. X
  1704. X    if( shortstr != NULL ) {        /* have short string */
  1705. X    if( longstr != NULL ) {
  1706. X        /* was once ':' */
  1707. X        sprintf( location, "%s; %s", shortstr, longstr );
  1708. X        return( location );
  1709. X    }
  1710. X    else
  1711. X        return( shortstr );
  1712. X    } /* short str */
  1713. X    else if( longstr != NULL )
  1714. X    return( longstr );
  1715. X    return( "Unknown" );
  1716. X} /* getttyloc */
  1717. X
  1718. X/*
  1719. X * Local variables:
  1720. X * comment-column: 40
  1721. X * End:
  1722. X */
  1723. END_OF_getttyloc.c
  1724. if test 16826 -ne `wc -c <getttyloc.c`; then
  1725.     echo shar: \"getttyloc.c\" unpacked with wrong size!
  1726. fi
  1727. # end of overwriting check
  1728. fi
  1729. echo shar: End of archive 7 \(of 7\).
  1730. cp /dev/null ark7isdone
  1731. MISSING=""
  1732. for I in 1 2 3 4 5 6 7 ; do
  1733.     if test ! -f ark${I}isdone ; then
  1734.     MISSING="${MISSING} ${I}"
  1735.     fi
  1736. done
  1737. if test "${MISSING}" = "" ; then
  1738.     echo You have unpacked all 7 archives.
  1739.     rm -f ark[1-9]isdone
  1740. else
  1741.     echo You still need to unpack the following archives:
  1742.     echo "        " ${MISSING}
  1743. fi
  1744. ##  End of shell archive.
  1745. exit 0
  1746.  
  1747.